<template>
  <a-modal
    title="商户级限额管理详情"
    v-model="show"
    :maskClosable="false"
    :width="1050"
    placement="right"
    :closable="true"
    @cancel="onClose"
    :footer="null"
    :visiable="mchntNoLevelInfoVisiable"
  >
    <a-form :form="form">
      <a-row>限额详情</a-row>
      <a-row>
        <a-col :md="12" :sm="24">
          <a-form-item label="商户等级"
                       v-bind="formItemLayout">
            <a-input v-decorator="['mchntLevelName']" :disabled="true"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item label="日累计限额"
                       v-bind="formItemLayout">
            <a-input v-decorator="['dayLimitAmt']" :disabled="true"/>
          </a-form-item>
        </a-col>
      </a-row>
      <a-row>
        <a-col :md="12" :sm="24">
          <a-form-item label='月累计限额'
                       v-bind="formItemLayout">
            <a-input v-decorator="['monthLimitAmt']" :disabled="true"/>
          </a-form-item>
        </a-col>
      </a-row>

      <a-row>借记限额</a-row>
      <a-row>
        <a-col :md="12" :sm="24">
          <a-form-item label="单笔借记限额"
                       v-bind="formItemLayout">
            <a-input v-decorator="['singleLimitLoanMaxAmt']" :disabled="true"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item label='日累计借记限额'
                       v-bind="formItemLayout">
            <a-input v-decorator="['dayLimitLoanAmt']" :disabled="true"/>
          </a-form-item>
        </a-col>
      </a-row>
      <a-row>
        <a-col :md="12" :sm="24">
          <a-form-item label="月累计借记限额"
                       v-bind="formItemLayout">
            <a-input v-decorator="['monthLimitLoanAmt']" :disabled="true"/>
          </a-form-item>
        </a-col>
      </a-row>

      <a-row>贷记限额</a-row>
      <a-row>
        <a-col :md="12" :sm="24">
          <a-form-item label="单笔贷记限额"
                       v-bind="formItemLayout">
            <a-input v-decorator="['singleLimitCreditMaxAmt']" :disabled="true"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="24">
          <a-form-item label='日累计贷记限额'
                       v-bind="formItemLayout">
            <a-input v-decorator="['dayLimitCreditAmt']" :disabled="true"/>
          </a-form-item>
        </a-col>
      </a-row>
      <a-row>
        <a-col :md="12" :sm="24">
          <a-form-item label="月累计贷记限额"
                       v-bind="formItemLayout">
            <a-input v-decorator="['monthLimitCreditAmt']" :disabled="true"/>
          </a-form-item>
        </a-col>
      </a-row>
      <a-row>
        <a-col :md="12" :sm="24">
          <a-form-item label="审批意见"
                       v-bind="formItemLayout">
            <a-textarea v-decorator="['auditRefuseReason']" :disabled="true"/>
          </a-form-item>
        </a-col>
      </a-row>

      <br>

    </a-form>


  </a-modal>

</template>
<script>

  const formItemLayout = {
    labelCol: {span: 8},
    wrapperCol: {span: 16}
  }
  export default {
    name: 'MchntNoLevelInfo',

    props: {
      mchntNoLevelInfoVisiable: {
        default: false
      },
      instId: '',
    },
    data() {
      return {
        data: [],
        suData: [],
        mchntNoLevelInfo: {
          visiable: false
        },
        loading: false,
        formItemLayout,
        form: this.$form.createForm(this),
        validateStatus: '',
        // firstValue: {},
        info: {
          infoName: '',
          remark: '',
          menuId: ''
        }
      }
    },
    computed: {
      show: {
        get: function () {
          return this.mchntNoLevelInfoVisiable
        },
        set: function () {
        }
      }
    },
    mounted() {

    },

    methods: {

      reset() {
        this.loading = false
        this.form.resetFields()
      },
      onClose() {
        this.reset()
        this.$emit('close')
      },

      setMerchantLevelManagerFormValues(mchntNoLevelInfos) {
        let fields = ['mchntLevelName', 'dayLimitAmt', 'monthLimitAmt', 'singleLimitLoanMaxAmt', 'dayLimitLoanAmt',
          'monthLimitLoanAmt', 'singleLimitCreditMaxAmt', 'dayLimitCreditAmt', 'monthLimitCreditAmt', 'refundDayLimitAmt','auditRefuseReason'
          ]
        Object.keys(mchntNoLevelInfos).forEach((key) => {
          if (fields.indexOf(key) !== -1) {
            this.form.getFieldDecorator(key)
            let obj = {}
            obj[key] = mchntNoLevelInfos[key]
            this.form.setFieldsValue(obj)
          }
        })
        this.suData=mchntNoLevelInfos;
      },


    },

  }
</script>



